<div class="view-header">
    <span ng-show="!add_open && !edit_open">
        <div class="search-phone">
            <input type="text" ng-model="search_params.phone" placeholder="电话">
            <i class="fa fa-mobile-phone"></i>
        </div>
        <div class="search-shop">
            <i class="fa fa-user"></i>
            <salesman-picker ng-model="search_params.user"></salesman-picker>
        </div>
        <div class="search-date">
            <i class="fa fa-calendar search-date-i"></i>
            <datetimepicker class="search-date-start" min-view="2"
                                    end-date="search_params.date_end"
                                    ng-model="search_params.date_start"></datetimepicker>
        </div>
        <div class="search-date">
            <i class="fa fa-calendar search-date-i"></i>
            <datetimepicker class="search-date-end" min-view="2"
                                    start-date="search_params.date_start"
                                    ng-model="search_params.date_end"></datetimepicker>
        </div>
    </span>

    <div class="view-header-left">
        <!-- 查询 -->
        <div class="view-header-item no-widen" ng-click="evaluated_refresh()" title="查询">
            <i class="fa fa-search"></i>
        </div>

        <div class="view-header-item color-open" title="添加购买记录"
             ng-click="add_open = !add_open;record_add.purchase_type =2" ng-show="!add_open && !edit_open">
            <i class="fa fa-plus"></i> 新增寄售
        </div>

        <!-- add -->
        <div class="view-header-item color-close above-cover no-widen"
             title="关闭" ng-click="add_open = !add_open"
             ng-show="add_open">
            <i class="fa fa-close"></i>
        </div>
        <!-- <div class="view-header-item color-save above-cover no-widen"
             title="保存" ng-click="save_add()"
             ng-show="add_open">
            <i class="fa fa-save"></i>
        </div> -->
        <div class="view-header-item above-cover"
             title="评估"
             ng-click='form_add.$valid?save_add():{};'
             title="评估提交{{form_add.$invalid?'请完成表单后再提交!':''}}"
             ng-show="add_open">
            <i class="fa fa-ticket" ng-show="form_add.$valid"></i>
            <i class="fa fa-ban" ng-show="form_add.$invalid"></i>
            {{form_add.$invalid?'完善表单!':' 评估提交'}}
        </div>
        

        <!-- edit-->
        <div class="view-header-item color-open above-cover no-widen"
             title="关闭"
             ng-click="edit_open = !edit_open" ng-show="edit_open">
            <i class="fa fa-close"></i>
        </div>
        <!-- <div class="view-header-item color-save above-cover no-widen"
             title="保存" ng-click="save_edit()"
             ng-show="edit_open">
            <i class="fa fa-save"></i>
        </div> -->

        <!--  record_edit.customer_type == 0   待评估-->
        <div class="view-header-item color-save above-cover"
             title="确认评估" ng-click="purchase_used_car_edit_0.$valid?save_edit():{}"
             ng-show="edit_open && record_edit.customer_type == 0">
            <i class="fa fa-ticket" ng-show="purchase_used_car_edit_0.$valid"></i>
            <i class="fa fa-ban" ng-show="purchase_used_car_edit_0.$invalid"></i>
            {{purchase_used_car_edit_0.$invalid?'完善表单!':'确认评估'}}
        </div>

        <!--  record_edit.customer_type == 1   已评估-->
        <div class="view-header-item color-save above-cover"
             title="确认评估" ng-click="purchase_used_car_edit_1.$valid?save_edit():{}"
             ng-show="edit_open && record_edit.customer_type == 1">
            <i class="fa fa-ticket" ng-show="purchase_used_car_edit_1.$valid"></i>
            <i class="fa fa-ban" ng-show="purchase_used_car_edit_1.$invalid"></i>
            {{purchase_used_car_edit_1.$invalid?'完善表单!':'确认评估'}}
        </div>



        <div class="view-header-item above-cover"
             title="确认修改"
             ng-click='purchase_used_car_edit_0.$valid && purchase_used_car_edit_1.$valid?submit_edit():{};'
             title="修改提交{{purchase_used_car_edit_0.$invalid && purchase_used_car_edit_1.$invalid?'请完成表单后再提交!':''}}"
             ng-show="edit_open && (purchase_used_car_edit_0.$valid && purchase_used_car_edit_1.$valid)">
            <i class="fa fa-check" ng-show="purchase_used_car_edit_0.$valid && purchase_used_car_edit_1.$valid"></i>
            <i class="fa fa-ban" ng-show="purchase_used_car_edit_0.$invalid || purchase_used_car_edit_1.$invalid"></i>
            {{purchase_used_car_edit_0.$invalid || purchase_used_car_edit_1.$invalid?'完善表单!':'确认提交'}}
        </div>

    </div>

</div>
<div class="view-content ">
    <div ag-grid="assessment_grid" class="ag-fresh ag-custom-center drag-top" style="height :40%"></div>
    <div class="drag"><span class="fa fa-navicon"></span></div>
    <div ag-grid="evaluated_grid" class="ag-fresh ag-custom-center drag-bottom" style="height :calc(60% - 20px)"></div>
</div>

<!-- add -->
<div class="data-overlay" ng-show="add_open">
    <div class="overlay-container" ng-click="warehouse_picker = false">
        <div class="overlay-header">二手车评估--新增</div>
        <div class="overlay-content" ng-form name="form_add" novalidate="novalidate">
            <div style ='position: relative;
                        width: 66.66%;
                        display: flex;
                        flex-direction: row;
                        justify-content: left;
                        align-items: stretch;'
                        ng-class="{true:'bor-red', false:''}[record_add.purchase_type == 3]">
                <div class="overlay-column" style="width:50%;">
                    <div class="overlay-item">
                        <span class="overlay-name">品牌</span>
                        <input type="text" name="brand" ng-required="true" ng-model="record_add.brand">
                        <p ng-show="form_add.brand.$invalid" class="new-item-bottom">
                            品牌必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车型</span>
                        <input type="text" name="model" ng-required="true" ng-model="record_add.model">

                        <p ng-show="form_add.model.$invalid" class="new-item-bottom">
                            车型必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">型号</span>
                        <input type="text" name="version" ng-required="true" ng-model="record_add.version">

                        <p ng-show="form_add.version.$invalid" class="new-item-bottom">
                            型号必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">颜色</span>
                        <input type="text" name="color" ng-required="true" ng-model="record_add.color">

                        <p ng-show="form_add.color.$invalid" class="new-item-bottom">
                            颜色必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">表征里程</span>
                        <input type="number" min="0" step="1" name="miles" ng-required="true" ng-model="record_add.miles">

                        <p ng-show="form_add.miles.$invalid" class="new-item-bottom">
                            表征里程必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">初登日期</span>
                        <datetimepicker class="search-date-start"
                                        ng-required="true"
                                        name="register_date"
                                        min-view="2"
                                        ng-model="record_add.register_date"></datetimepicker>
                        <p ng-show="form_add.register_date.$invalid" class="new-item-bottom">
                            初登日期必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">排量</span>
                        <input type="number" min="0" step="0.1" name="displacement" ng-required="true" ng-model="record_add.displacement.n">

                        <div class="overlay-item-choose">
                            <label>
                                L
                                <input type="radio" name="displacement" ng-required="true" value="L" ng-model="record_add.displacement.t">
                            </label>
                            <label>
                                T
                                <input type="radio" name="displacement" ng-required="true" value="T" ng-model="record_add.displacement.t">
                            </label>
                        </div>
                        <p ng-show="form_add.displacement.$invalid" class="new-item-bottom">
                            排量必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">变速箱</span>
                        <select ng-model="record_add.transmission" ng-required="true" name="transmission">
                            <option value="MT">手动</option>
                            <option value="AT">自动</option>
                        </select>

                        <p ng-show="form_add.transmission.$invalid" class="new-item-bottom">
                            变速箱必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车牌号</span>
                        <input type="text" name="license_plate" ng-required="true" ng-model="record_add.license_plate">
                        <p ng-show="form_add.license_plate.$invalid" class="new-item-bottom">
                            车牌号必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车架号</span>
                        <input type="text" name="vid" ng-required="true" ng-model="record_add.vid">
                        <p ng-show="form_add.vid.$invalid" class="new-item-bottom">
                            车架号必填（后七位）
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车况</span>
                        <select ng-model="record_add.vehicle_status" ng-required="true" name="vehicle_status">
                            <option value="0">较差</option>
                            <option value="1">一般</option>
                            <option value="2">较好</option>
                            <option value="3">很好</option>
                        </select>
                        <p ng-show="form_add.vehicle_status.$invalid" class="new-item-bottom">
                            车况必填
                        </p>
                    </div>
                </div>
                <div class="overlay-column" style="width:50%;">
                    <div class="overlay-item">
                        <span class="overlay-name">收购类型</span>
                        <select ng-model="record_add.purchase_type" ng-required="true" name="purchase_type">
                            <option value="2" selected>寄售</option>
                            <option value="3" selected>外采</option>
                        </select>
                        <p ng-show="form_add.purchase_type.$invalid" class="new-item-bottom">
                            收购类型必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_add.purchase_type == 3">
                        <span class="overlay-name">外采门店</span>
                        <input type="text" ng-model="record_add.purchase_unit" ng-required="record_add.purchase_type == 3" name="purchase_unit"/>
                        <p ng-show="form_add.purchase_unit.$invalid" class="new-item-bottom">
                            外采门店必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_add.purchase_type == 2 || record_add.purchase_type == 3">
                        <span class="overlay-name">推荐人</span>
                        <input type="text" ng-model="record_add.referral" ng-required="record_add.purchase_type == 2 || record_add.purchase_type == 3" name="referral"/>
                        <p ng-show="form_add.referral.$invalid" class="new-item-bottom">
                            推荐人必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_add.purchase_type == 2 || record_add.purchase_type == 3">
                        <span class="overlay-name">推荐人部门</span>
                        <select ng-model="record_add.referral_position" ng-required="record_add.purchase_type == 2 || record_add.purchase_type == 3" name="referral_position">
                            <option value="销售">销售</option>
                            <option value="售后">售后</option>
                            <option value="行政">行政</option>
                            <option value="财务">财务</option>
                            <option value="客服">客服</option>
                            <option value="市场">市场</option>
                            <option value="集团">集团</option>
                            <option value="无" ng-show="record_add.purchase_type == 3">无</option>
                        </select>
                        <p ng-show="form_add.referral_position.$invalid" class="new-item-bottom">
                            推荐人部门必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">评估师</span>
                        <evaluator-picker ng-required="true" name="appraiser"
                                          ng-model="record_add.appraiser" ></evaluator-picker>
                        <p ng-show="form_add.appraiser.$invalid" class="new-item-bottom">
                            评估师必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车主姓名</span>
                        <input type="text" ng-model="record_add.customer_name" ng-required="true" name="customer_name"/>
                        <p ng-show="form_add.customer_name.$invalid" class="new-item-bottom">
                            车主姓名必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">客户来源</span>
                        <select ng-model="record_add.customer_source" ng-required="true" name="customer_source">
                            <option value="展示活动">展示活动</option>
                            <option value="转介绍">转介绍</option>
                            <option value="售后推荐">售后推荐</option>
                            <option value="外展">外展</option>
                        </select>
                        <p ng-show="form_add.customer_source.$invalid" class="new-item-bottom">
                            客户来源必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">电话</span>
                        <input type="text" ng-model="record_add.phone" ng-pattern = "/^[0-9]{11}$/" ng-required="true" name="phone"/>
                        <p ng-show="form_add.phone.$invalid" class="new-item-bottom">
                            电话必填(仅支持11位)
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_add.purchase_type == 2">
                        <span class="overlay-name">寄售日期</span>
                        <datetimepicker class="search-date-start"
                                        min-view="2"
                                        ng-required="record_add.purchase_type == 2"
                                        name="purchase_date"
                                        ng-model="record_add.purchase_date"></datetimepicker>
                        <p ng-show="form_add.purchase_date.$invalid" class="new-item-bottom">
                            寄售日期必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_add.purchase_type == 3">
                        <span class="overlay-name">外采日期</span>
                        <datetimepicker class="search-date-start"
                                        min-view="2"
                                        ng-required="record_add.purchase_type == 3"
                                        name="purchase_date"
                                        ng-model="record_add.purchase_date"></datetimepicker>
                        <p ng-show="form_add.purchase_date.$invalid" class="new-item-bottom">
                            外采日期必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_add.purchase_type == 3">
                        <span class="overlay-name">外采价格</span>
                        <input type="text" ng-model="record_add.appraise_price" ng-required="record_add.purchase_type == 3" name="appraise_price"/>
                        <p ng-show="form_add.appraise_price.$invalid" class="new-item-bottom">
                            外采价格必填
                        </p>
                    </div>
                </div>
            </div>
            <div style ='position: relative;
                        width: 33.33%;
                        display: flex;
                        flex-direction: row;
                        justify-content: left;
                        align-items: stretch;'>
                <div ng-class="{true:'ready-only', false:''}[record_add.purchase_type == 3]"></div>
                <div class="overlay-column" style="width:100%;">
                    
                    <div class="overlay-item">
                        <span class="overlay-name">过户服务费</span>
                        <input type="text" ng-model="record_add.transfer_fee" ng-required="record_add.purchase_type == 2" name="transfer_fee"/>
                        <p ng-show="form_add.transfer_fee.$invalid" class="new-item-bottom">
                            过户服务费必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">预期库存风险期</span>
                        <input type="text" ng-model="record_add.expect_store_risk" ng-required="record_add.purchase_type == 2" name="expect_store_risk"/>
                        <p ng-show="form_add.expect_store_risk.$invalid" class="new-item-bottom">
                            预期库存风险期必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">其它收购成本</span>
                        <input type="text" ng-model="record_add.extra_fee" ng-required="record_add.purchase_type == 2" name="extra_fee"/>
                        <p ng-show="form_add.extra_fee.$invalid" class="new-item-bottom">
                            其它收购成本必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">备注</span>
                        <input type="text" ng-model="record_add.remark" name="remark"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- edit -->
<div class="data-overlay" ng-show="edit_open">
    <div class="overlay-container" ng-click="warehouse_picker = false">
        <div class="overlay-header">二手车评估--修改</div>
        <div class="overlay-content">
            <div style ='position: relative;
                        width: 66.66%;
                        display: flex;
                        flex-direction: row;
                        justify-content: left;
                        align-items: stretch;'
                        ng-class="{true:'bor-red', false:''}[record_edit.customer_type == 0]"
                        ng-form name="purchase_used_car_edit_0" novalidate="novalidate">
                <div ng-class="{true:'ready-only', false:''}[record_edit.customer_type == 1]"></div>
                <div class="overlay-column" style="width:50%;">
                    <div class="overlay-item">
                        <span class="overlay-name">品牌</span>
                        <input type="text" name="brand" ng-required="true" ng-model="record_edit.brand">
                        <p ng-show="purchase_used_car_edit_0.brand.$invalid" class="new-item-bottom">
                            品牌必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车型</span>
                        <input type="text" name="model" ng-required="true" ng-model="record_edit.model">

                        <p ng-show="purchase_used_car_edit_0.model.$invalid" class="new-item-bottom">
                            车型必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">型号</span>
                        <input type="text" name="version" ng-required="true" ng-model="record_edit.version">

                        <p ng-show="purchase_used_car_edit_0.version.$invalid" class="new-item-bottom">
                            型号必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">颜色</span>
                        <input type="text" name="color" ng-required="true" ng-model="record_edit.color">

                        <p ng-show="purchase_used_car_edit_0.color.$invalid" class="new-item-bottom">
                            颜色必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">表征里程</span>
                        <input type="number" step="1" min="0" name="miles" ng-required="true" ng-model="record_edit.miles">

                        <p ng-show="purchase_used_car_edit_0.miles.$invalid" class="new-item-bottom">
                            表征里程必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">初登日期</span>
                        <datetimepicker class="search-date-start"
                                        ng-required="true"
                                        name="register_date"
                                        min-view="2"
                                        ng-model="record_edit.register_date"></datetimepicker>
                        <p ng-show="purchase_used_car_edit_0.register_date.$invalid" class="new-item-bottom">
                            初登日期必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">排量</span>
                        <input type="text" min="0" step="0.1" name="displacement" ng-required="true" ng-model="record_edit.displacement.n">

                        <div class="overlay-item-choose">
                            <label>
                                L
                                <input type="radio" name="displacement" ng-required="true" value="L" ng-model="record_edit.displacement.t">
                            </label>
                            <label>
                                T
                                <input type="radio" name="displacement" ng-required="true" value="T" ng-model="record_edit.displacement.t">
                            </label>
                        </div>
                        <p ng-show="purchase_used_car_edit_0.displacement.$invalid" class="new-item-bottom">
                            排量必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">变速箱</span>
                        <select ng-model="record_edit.transmission" ng-required="true" name="transmission">
                            <option value="MT">手动</option>
                            <option value="AT">自动</option>
                        </select>

                        <p ng-show="purchase_used_car_edit_0.transmission.$invalid" class="new-item-bottom">
                            变速箱必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车牌号</span>
                        <input type="text" name="license_plate" ng-required="true" ng-model="record_edit.license_plate">
                        <p ng-show="purchase_used_car_edit_0.license_plate.$invalid" class="new-item-bottom">
                            车牌号必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车架号</span>
                        <input type="text" name="vid" ng-model="record_edit.vid">
                        <p ng-show="purchase_used_car_edit_0.vid.$invalid" class="new-item-bottom">
                            车架号必填（后七位）
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车况</span>
                        <select ng-model="record_edit.vehicle_status" ng-required="true" name="vehicle_status">
                            <option value="0">较差</option>
                            <option value="1">一般</option>
                            <option value="2">较好</option>
                            <option value="3">很好</option>
                        </select>

                        <p ng-show="purchase_used_car_edit_0.vehicle_status.$invalid" class="new-item-bottom">
                            车况必填
                        </p>
                    </div>
                </div>
                <div class="overlay-column" style="width:50%;">
                    <div class="overlay-item">
                        <span class="overlay-name">收购类型</span>
                        <select ng-model="record_edit.purchase_type" ng-required="true" name="purchase_type">
                            <option value="0">置换</option>
                            <option value="1">收购</option>
                            <option value="2">寄售</option>
                            <option value="3">外采</option>
                        </select>
                        <p ng-show="purchase_used_car_edit_0.purchase_type.$invalid" class="new-item-bottom">
                            收购类型必填
                        </p>
                    </div>

                    <div class="overlay-item" ng-show="record_edit.purchase_type == 0">
                        <span class="overlay-name">置换门店</span>
                        <input type="text" ng-model="record_edit.purchase_unit" ng-required="record_edit.purchase_type == 0" name="purchase_unit"/>
                        <p ng-show="purchase_used_car_edit_0.purchase_unit.$invalid" class="new-item-bottom">
                            置换门店必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 1">
                        <span class="overlay-name">收购门店</span>
                        <input type="text" ng-model="record_edit.purchase_unit" ng-required="record_edit.purchase_type == 1" name="purchase_unit_1"/>
                        <p ng-show="purchase_used_car_edit_0.purchase_unit_1.$invalid" class="new-item-bottom">
                            收购门店必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 0">
                        <span class="overlay-name">销售顾问</span>
                        <input type="text" ng-model="record_edit.referral" ng-required="record_edit.purchase_type == 0" name="referral"/>
                        <p ng-show="purchase_used_car_edit_0.referral.$invalid" class="new-item-bottom">
                            销售顾问必填
                        </p>
                    </div>
                    <div class="overlay-item"
                         ng-show="record_edit.purchase_type == 1 || record_edit.purchase_type == 2 || record_edit.purchase_type == 3">
                        <span class="overlay-name">推荐人</span>
                        <input type="text" ng-model="record_edit.referral" ng-required="record_edit.purchase_type == 1 || record_edit.purchase_type == 2  || record_edit.purchase_type == 3" name="referral_other"/>
                        <p ng-show="purchase_used_car_edit_0.referral_other.$invalid" class="new-item-bottom">
                            推荐人必填
                        </p>
                    </div>
                    <div class="overlay-item"
                         ng-show="record_edit.purchase_type == 1 || record_edit.purchase_type == 2">
                        <span class="overlay-name">推荐人部门</span>
                        <select ng-model="record_edit.referral_position" ng-required="record_edit.purchase_type == 1 || record_edit.purchase_type == 2" name="referral_position">
                            <option value="销售">销售</option>
                            <option value="售后">售后</option>
                            <option value="行政">行政</option>
                            <option value="财务">财务</option>
                            <option value="客服">客服</option>
                            <option value="市场">市场</option>
                            <option value="集团">集团</option>
                        </select>
                        <p ng-show="purchase_used_car_edit_0.referral_position.$invalid" class="new-item-bottom">
                            推荐人部门必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">评估师</span>
                        <evaluator-picker ng-required="true" name="appraiser"
                                          ng-model="record_edit.appraiser" ></evaluator-picker>
                        <p ng-show="purchase_used_car_edit_0.appraiser.$invalid" class="new-item-bottom">
                            评估师必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">车主姓名</span>
                        <input type="text" ng-model="record_edit.customer_name" ng-required="true" name="customer_name"/>
                        <p ng-show="purchase_used_car_edit_0.customer_name.$invalid" class="new-item-bottom">
                            车主姓名必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">客户来源</span>
                        <select ng-model="record_edit.customer_source" ng-required="true" name="customer_source">
                            <option value="展示活动">展示活动</option>
                            <option value="转介绍">转介绍</option>
                            <option value="售后推荐">售后推荐</option>
                            <option value="外展">外展</option>
                        </select>
                        <p ng-show="purchase_used_car_edit_0.customer_source.$invalid" class="new-item-bottom">
                            客户来源必填
                        </p>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">电话</span>
                        <input type="text" ng-model="record_edit.phone" ng-pattern = "/^[0-9]{11}$/" ng-required="true" name="phone"/>
                        <p ng-show="purchase_used_car_edit_0.phone.$invalid" class="new-item-bottom">
                            电话必填(仅支持11位)
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 0">
                        <span class="overlay-name">置换车型</span>
                        <input type="text" ng-model="record_edit.replacement_vehicle" ng-required="record_edit.purchase_type == 0" name="replacement_vehicle"/>
                        <p ng-show="purchase_used_car_edit_0.replacement_vehicle.$invalid" class="new-item-bottom">
                            置换车型必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 0">
                        <span class="overlay-name">置换日期</span>
                        <datetimepicker class="search-date-start"
                                        min-view="2"
                                        ng-required="record_edit.purchase_type == 0" 
                                        name="purchase_date"
                                        ng-model="record_edit.purchase_date"></datetimepicker>
                        <p ng-show="purchase_used_car_edit_0.purchase_date.$invalid" class="new-item-bottom">
                            置换日期必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 1">
                        <span class="overlay-name">评估日期</span>
                        <datetimepicker class="search-date-start"
                                        min-view="2"
                                        ng-required="record_edit.purchase_type == 1" 
                                        name="purchase_date_1"
                                        ng-model="record_edit.purchase_date"></datetimepicker>
                        <p ng-show="purchase_used_car_edit_0.purchase_date_1.$invalid" class="new-item-bottom">
                            评估日期必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 0 || record_edit.purchase_type == 1">
                        <span class="overlay-name">评估价格</span>
                        <input type="text" ng-model="record_edit.appraise_price" ng-required="record_edit.purchase_type == 0 || record_edit.purchase_type == 1" name="appraise_price"/>
                        <p ng-show="purchase_used_car_edit_0.appraise_price.$invalid" class="new-item-bottom">
                            评估价格必填
                        </p>
                    </div>
                    <div class="overlay-item" ng-show="record_edit.purchase_type == 2">
                        <span class="overlay-name">寄售日期</span>
                        <datetimepicker class="search-date-start"
                                        min-view="2"
                                        ng-required="record_edit.purchase_type == 2"
                                        name="purchase_date_2"
                                        ng-model="record_edit.purchase_date"></datetimepicker>
                        <p ng-show="purchase_used_car_edit_0.purchase_date_2.$invalid" class="new-item-bottom">
                            寄售日期必填
                        </p>
                    </div>
                </div>
            </div>

            <div style ='position: relative;
                        width: 33.33%;
                        display: flex;
                        flex-direction: row;
                        justify-content: left;
                        align-items: stretch;' ng-class="{true:'bor-red', false:''}[record_edit.customer_type == 1]" ng-form name="purchase_used_car_edit_1" novalidate="novalidate">
                    <div ng-class="{true:'ready-only', false:''}[record_edit.customer_type == 0]"></div>
                    <div class="overlay-column" style="width:100%;">
                        <div class="overlay-item" ng-show="record_edit.purchase_type == 0 || record_edit.purchase_type == 1">
                            <span class="overlay-name">收购日期</span>
                            <datetimepicker class="search-date-start"
                                            min-view="2"
                                            ng-required="record_edit.purchase_type == 0 || record_edit.purchase_type == 1"
                                            name="submit_date"
                                            ng-model="record_edit.submit_date"></datetimepicker>
                            <p ng-show="purchase_used_car_edit_1.submit_date.$invalid && record_edit.customer_type == 1" class="new-item-bottom">
                                收购日期必填
                            </p>
                        </div>
                        <div class="overlay-item"
                             ng-show="record_edit.purchase_type == 0 || record_edit.purchase_type == 1">
                            <span class="overlay-name">收购价格</span>
                            <input type="text" ng-model="record_edit.purchase_price" ng-required="record_edit.purchase_type == 0 || record_edit.purchase_type == 1" name="purchase_price"/>
                            <p ng-show="purchase_used_car_edit_1.purchase_price.$invalid && record_edit.customer_type == 1" class="new-item-bottom">
                                收购价格必填
                            </p>
                        </div>
                        <div class="overlay-item">
                            <span class="overlay-name">过户服务费</span>
                            <input type="text" ng-model="record_edit.transfer_fee" ng-required="true" name="transfer_fee"/>
                            <p ng-show="purchase_used_car_edit_1.transfer_fee.$invalid && record_edit.customer_type == 1" class="new-item-bottom">
                                过户服务费必填
                            </p>
                        </div>
                        <div class="overlay-item">
                            <span class="overlay-name">预期库存风险期</span>
                            <input type="text" ng-model="record_edit.expect_store_risk" ng-required="true" name="expect_store_risk"/>
                            <p ng-show="purchase_used_car_edit_1.expect_store_risk.$invalid && record_edit.customer_type == 1" class="new-item-bottom">
                                预期库存风险期必填
                            </p>
                        </div>
                        <div class="overlay-item">
                            <span class="overlay-name">其它收购成本</span>
                            <input type="text" ng-model="record_edit.extra_fee" ng-required="true" name="extra_fee"/>
                            <p ng-show="purchase_used_car_edit_1.extra_fee.$invalid && record_edit.customer_type == 1" class="new-item-bottom">
                                其它收购成本必填
                            </p>
                        </div>
                        <div class="overlay-item">
                            <span class="overlay-name">备注</span>
                            <input type="text" ng-model="record_edit.remark" name="remark"/>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
                




<script type="text/javascript">
$(document).ready(function() {

        $(document).on('mousedown','.drag',function(e){
            e.preventDefault();
            var drag_t = e.pageY;
            var drag_top = $('.drag-top');
            var drag_bottom = $('.drag-bottom');
            var b_h = drag_bottom.height();
            var t_h = drag_top.height();

            $(document).mousemove(function(e){
                var t = e.pageY;

                if (t <= drag_t) {
                    
                    var p = drag_t - e.pageY;

                    drag_bottom.height(b_h + p);
                    drag_top.height(t_h - p);

                }else if(t > drag_t){
                    var e = e.pageY - drag_t;

                    drag_bottom.height(b_h - e);
                    drag_top.height(t_h + e);
                }
            });
        });
        $(document).on('mouseup',function(){
            $(this).unbind('mousemove');
        });
    
});
</script>